package com.wendyxie.sproutup.enum

/**
 * ONCE单次，DAY每日，WEEK每周，MONTH每月
 */
enum class ScoreFrequencyEnum(val value: String) {
    ONCE("ONCE"),
    DAY("DAY"),
    WEEK("WEEK"),
    MONTH("MONTH");

    companion object {
        fun fromString(value: String): ScoreFrequencyEnum{
            return when(value) {
                "ONCE" -> ONCE
                "DAY" -> DAY
                "WEEK" -> WEEK
                "MONTH" -> MONTH
                else -> throw IllegalArgumentException("Invalid value: $value")
            }
        }
    }
}
